{% extends 'fruitShop/base_user.html' %}
{% block body_content_inner %}
    {% load static %}

	<div class="main_con clearfix">
		<div class="left_menu_con clearfix">
			<h3>用户中心</h3>
			<ul>
				<li><a href="{% url 'fruitShop:user_info' %}">· 个人信息</a></li>
				<li><a href="{% url 'fruitShop:user_order' 1 %}" class="active">· 全部订单</a></li>
				<li><a href="{% url 'fruitShop:user_site' %}">· 收货地址</a></li>
			</ul>
		</div>
        {% for order in page %}
		<div class="right_content clearfix">
				<h3 class="common_title2">全部订单</h3>
				<ul class="order_list_th w978 clearfix">
					<li class="col01">{{ order.date }}</li>
					<li class="col02">订单号：{{ order.id }}</li>
					<li class="col02 stress">
                        {% if order.isPay == 1 %}
                            已支付
                            {% else %}
                            未支付
                        {% endif %}
                        </li>
				</ul>

				<table class="order_list_table w980">
					<tbody>
						<tr>
							<td width="55%">
                                {% for good in order.detail %}
								<ul class="order_goods_list clearfix">					
									<li class="col01"><img src="{% static 'fruitShop/upload_images/' %}{{ good.goods.picture }}"></li>
									<li class="col02">{{  good.goods.name  }}<em>{{ good.goods.price }}元/{{ good.goods.unit }}</em></li>
									<li class="col03">{{ good.number }}件</li>
									<li class="col04">{{ good.price }}元</li>
								</ul>
                                    {% endfor %}
							</td>
							<td width="15%">{{ order.totalPrice }}元</td>
                        {% if order.isPay == 1 %}
							<td width="15%">以付款</td>
                            <td width="15%"><a href="#" class="oper_btn">查物流</a></td>

                            {% else %}
                            <td width="15%">待付款</td>
							<td width="15%"><a href="{% url 'fruitShop:pay' order.id %}" class="oper_btn">去付款</a></td>
                        {% endif %}
						</tr>
					</tbody>
				</table>
{% endfor %}

    <div class="pagenation">
                {% if page.has_previous %}
				<a href="{% url 'fruitShop:user_order' page.previous_page_number %}"><上一页</a>
                {% endif %}

                {% for p_index in page.paginator.page_range %}
                    {% if p_index == page.number %}
                        <a href="javascript:;" class="active">{{ p_index }}</a>
                    {% else %}
                        <a href="{% url 'fruitShop:user_order' p_index %}">{{ p_index }}</a>
                    {% endif %}
                {% endfor %}

                {% if page.has_next %}
                    <a href="{% url 'fruitShop:user_order' page.next_page_number %}">下一页></a>
                {% endif %}
			</div>

		</div>
	</div>

{% endblock %}